package com.cast.n2.n3;

import lombok.extern.slf4j.Slf4j;

/**
 * @program: juc
 * @description:
 * @author: lishuang
 * @create: 2021-10-13 17:22
 **/
@Slf4j(topic = "c.Test9")
public class Test9 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
        while (true){
            if (Thread.currentThread().isInterrupted()){
                log.debug("退出循环。。。。");
                break;
            }
        }
        },"t1");
        t1.start();
        Thread.sleep(1000);
        log.debug("interrupt");
        t1.interrupt();
    }
}